//Francisco "Kiko" Olvera
//Camera for DirectX
//Always pointed at center of board
//Can be rotated about center or moved directly above center
//Camera.h

#pragma once
#include "DX include.h"
#include "ENUM.h"

class Camera
{
private:
// camera variables
	D3DXMATRIX matView;	// the view matrix
	D3DXMATRIX matProj;	// the projection matrix
	D3DXVECTOR3 eyePos;	// the position of the camera
	D3DXVECTOR3 lookAt;	// where the camera is pointing
	D3DXVECTOR3 upVec;	// camera up direction
private:
	CAMERA_POSITIONS currentPos, lastPos;
	D3DXVECTOR3 SouthBoard;
	D3DXVECTOR3 WestBoard;
	D3DXVECTOR3 NorthBoard;
	D3DXVECTOR3 EastBoard;
	D3DXVECTOR3 UpBoard;
	D3DXVECTOR3 CenterBoard;
	D3DXVECTOR3 ViewBoard;
	void initPoints();
private:
	//movement
	CAM_MOVEMENT camMoving;
	D3DXVECTOR3 target;
	float theta;
	void rotateCameraClock(float);
	void rotateCameraCounterClock(float);
	void rotateCameraXPos(float);
	void rotateCameraXNeg(float);
	void rotateCameraZPos(float);
	void rotateCameraZNeg(float);
	void moveCameraUp(float);
	void rotateCameraUpVecClock(float);
	void rotateCameraUpVecCounterClock(float);
	void pointCamera(D3DXVECTOR3);
	inline void moveCamera(D3DXVECTOR3 vec)	{eyePos = vec;	pointCamera(CenterBoard);}
public:
	void createCamera(float, float);
	void Update();
	void moveCameraLeft();
	void moveCameraRight();
	void toggleCameraUp();
	CAM_MOVEMENT getCamMove()	{return camMoving;}
};